<?php
    require_once './model/categories.php';
    $obj = new Categories();
    $categories = $obj->select();
?>
<div id="sidebar2" class="sidebar">
    <ul>
        <li>
            <h2>Categories</h2>
            <ul>
                <?php foreach ($categories as $category):?>
                <li><a href="#"><?php echo $category['name'] ?></a></li>
                <?php endforeach; ?>
                
            </ul>
        </li>			
    </ul>
</div>